using System;
using System.Collections.Generic;
using System.Text;

namespace BuildingStructuralElements.Sections
{
    public class SelectionByIndexes : SelectionDataStrategy
    {
        private int fileIndex;
        private int profileIndex;
        public SelectionByIndexes(int profileIndex,int fileIndex)
        {
            this.fileIndex = fileIndex;
            this.profileIndex = profileIndex;
 
        }
        public int FileIndex
        {
            get
            {
                return this.fileIndex;
            }
            set
            {
                this.fileIndex = value;


            }
        }
        public int ProfileIndex
        {
            get
            {
                return this.profileIndex;

            }
            set
            {
                this.profileIndex = value;
            }
        } 
        public override CSectionData getCSectionData()
        {
                CSectionData data;
                data = new CSectionData();
                data.m_Data = new double[100];
                data.Name = "NULL";

            if (ProfileIndex >= 0)
            {
                try
                {
                    CSection_Facade.getDataStruct(ref data, 100, profileIndex, fileIndex);
                    this._csectionHeader = profileIndex;
                }
                catch (Exception exp)
                {
                    Console.Write(exp.Message);
                    throw (new SectionDllException ("_Section Cannot be Loaded. Strategy Executed SelectionByIndexes"));
                }


            }

            return data;

        }
    }
}
